Sheffield | 25-SDC-Nov | Hassan Osman | Sprint 4 | Implement cowsay in Python#267
Sheffield | 25-SDC-Nov | Hassan Osman | Sprint 4 | Implement cowsay in Python#267HassanOHOsman wants to merge 25 commits intoCodeYourFuture:mainfrom
Conversation
…esult of the arguments with spaces in between
…an end user can select from
|
Can you ignore the .venv file? It is difficult to review this as there are too many files in the PR. thanks |
Hi! I've just ignored it. Please let me know if there's anything else needs changing. Appreciate your help! :) |
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start, i've left some comments where you could improve further
implement-cowsay/cow.py
Outdated
| import sys | ||
| import argparse | ||
|
|
||
| listed_animals = [listed_animal for listed_animal in dir(cowsay) if callable(getattr(cowsay, listed_animal)) and not listed_animal.startswith("__") and listed_animal not in ["draw", "func", "get_output_string", "CowsayError"]] |
There was a problem hiding this comment.
This might work, but looking over every single item in dir(cowsay) and manually excluding the ones you dont want might not be very maintainable in the long term. Is there an easier way to access this information?
implement-cowsay/cow.py
Outdated
| args = parser.parse_args() | ||
|
|
||
| message = " ".join(args.message) | ||
| animal = args.animal or "cow" |
There was a problem hiding this comment.
You are setting a default argument here which is good, but perhaps there may be a neater way of doing this. Think about where the rest of the arguments are handled.
|
Well done, i think this is complete now! |
Self checklist
In this PR I Implemented a command-line tool using the cowsay library with dynamic animal options, message input, validation, and proper --help output.